using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
    public class userinfo
    {
            public long userid{get;set;}
            public string avatar{get;set;}
            public string infor{get;set;}
            public long indexuser{get;set;}
            public string hobby{get;set;}
            public string job{get;set;}
            public string link{get;set;}
            public string title{get;set;}
            public string metakeyword{get;set;}
            public string metadescription{get;set;}
            public string username{get;set;}
            public string birthdayExt { get; set; }
            public long id { get; set; }
         
        public userinfo()
        {       
                    avatar ="";   
                    infor ="";   
                    hobby ="";   
                    job ="";   
                    link ="";   
                    title ="";   
                    metakeyword ="";   
                    metadescription ="";   
                    username ="";   
        }
        
       static userinfo DynamicCast<T>(object row_data, object row_header) where T : userinfo
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           userinfo ret = new userinfo();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                   case "id":
                       ret.id = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "userid":
                        ret.userid = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "avatar":
                        ret.avatar = ConvertObject.ToString(dt[column]);
                       break;
                      case  "infor":
                        ret.infor = ConvertObject.ToString(dt[column]);
                       break;
                      case  "indexuser":
                        ret.indexuser = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "hobby":
                        ret.hobby = ConvertObject.ToString(dt[column]);
                       break;
                      case  "job":
                        ret.job = ConvertObject.ToString(dt[column]);
                       break;
                      case  "link":
                        ret.link = ConvertObject.ToString(dt[column]);
                       break;
                      case  "title":
                        ret.title = ConvertObject.ToString(dt[column]);
                       break;
                      case  "metakeyword":
                        ret.metakeyword = ConvertObject.ToString(dt[column]);
                       break;
                      case  "metadescription":
                        ret.metadescription = ConvertObject.ToString(dt[column]);
                       break;
                      case  "username":
                        ret.username = ConvertObject.ToString(dt[column]);
                       break;
                
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
